import Session from '@/utils/storage';
const GET_CURREN_FULL_SCREEN= 'getCurrenFullscreen';
const GET_TAG_VIEW_ROUTES= 'getTagsViewRoutes';

const tagsViewRoutesModule= {
	namespaced: true,
	state: {
		tagsViewRoutes: [],
		isTagsViewCurrenFull: false,
	},
	mutations: {
		// 设置 TagsView 路由
		[GET_TAG_VIEW_ROUTES](state: any, data: Array<string>) {
			state.tagsViewRoutes = data;
		},
		// 设置卡片全屏
		[GET_CURREN_FULL_SCREEN](state: any, bool: boolean) {
			Session.set('isTagsViewCurrenFull', bool);
			state.isTagsViewCurrenFull = bool;
		},
	},
	actions: {
		// 设置 TagsView 路由
		async setTagsViewRoutes({ commit }:any, data: Array<string>) {
			commit(GET_TAG_VIEW_ROUTES, data);
		},
		// 设置卡片全屏
		setCurrenFullscreen({ commit }:any, bool: Boolean) {
			commit(GET_CURREN_FULL_SCREEN, bool);
		},
	},
};

export default tagsViewRoutesModule;